<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: inc.get_customer_infos.php 528 2015-02-28 11:33:55Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 528 $
* 	zuletzt geaendert von:	$Author$
* 	Datum:					$Date: 2015-02-28 11:33:55 +0000 (Sat, 28 Feb 2015) $
*
* 	http://www.itdotmedia.de
*
* 	Copyright (c) since 2014
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
* 	(c) 2011     SEO:mercari - www.seo-mercari.de
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

function  get_customer_infos($customers_id) {
	global $db;

	$customer = $db->db_query("
		SELECT
			a.entry_gender, a.entry_company, a.entry_firstname, a.entry_lastname, 
			a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city,
			a.entry_state, a.entry_country_id, a.entry_zone_id,
			c.customers_email_address, c.customers_telephone,
			s.address_format_id
		FROM
			".TABLE_CUSTOMERS." c,
			".TABLE_ADDRESS_BOOK." a,
			".TABLE_COUNTRIES." s
		WHERE
			c.customers_id  = '".$customers_id."'
			AND c.customers_id = a.customers_id
			AND a.entry_country_id = s.countries_id
			AND c.customers_default_address_id = a.address_book_id");

	$customer_info_array = array(	
		'gender' 		=> $customer->fields['entry_gender'],
		'company' 	=> $customer->fields['entry_company'],
		'firstname' => $customer->fields['entry_firstname'],
		'lastname' 	=> $customer->fields['entry_lastname'],
		'street_address' => $customer->fields['entry_street_address'],
		'suburb' => $customer->fields['entry_suburb'],
		'postcode' => $customer->fields['entry_postcode'],
		'city' => $customer->fields['entry_city'],
		'state' => $customer->fields['entry_state'],
		'country_id' => $customer->fields['entry_country_id'],
		'zone_id' => $customer->fields['entry_zone_id'],
		'email_address' => $customer->fields['customers_email_address'],
		'telephone' => $customer->fields['customers_telephone'],
		'address_format_id' => $customer->fields['address_format_id']
	);
	
	return $customer_info_array;
}
?>